using System;
//using System.Numerics; - za BigInteger
class FactorialAndCalculateZeros
{
	static void Main()
	{
		//
		Console.Write("Input n: ");
		
		int n = int.Parse(Console.ReadLine());
		Console.WriteLine();
		
			decimal fact = 1;
			//BigInteger fact = 0;
			for(int number =n ; number >= 1; number--)
			{
				if(number==1)
				{
					Console.WriteLine("{0}={1}",number,fact);
				}
				else
				{
					Console.Write("{0}*",number);
					fact *= number ; 
				}
			}
			
			int zeros =0;
			if(fact>0)
			{
				if (fact == 0)
				{
					zeros+=1;
				}
				while (fact % 10 == 0)
				{
					fact = fact / 10;
					zeros++;
				}
				Console.WriteLine("Trailing zero's="+zeros);
					//TODO: S bitwise position X ==0 ?
					//Problem s promenlivata, che stava 0 sled purvoto izpulnenie.. inache si raboti methoda
			}
		
	}
}
					//Other way to calculate trailing zeros
					
					/*if((factorial/10000000)%10==0)
					{
						factorial = (factorial/100000)%10;
						zeros+=8;
						Console.WriteLine("+8  "+factorial);
					}
					else if((factorial/1000000)%10==0)
					{
						factorial = (factorial/100000)%10;
						zeros+=7;
						Console.WriteLine("+7  "+factorial);
					}
					else if((factorial/100000)%10==0)
					{
						factorial = (factorial/100000)%10;
						zeros+=6;
						Console.WriteLine("+6  "+factorial);
					}
					else if((factorial/10000)%10==0)
					{
						factorial = (factorial/10000)%10;
						zeros+=5;
						Console.WriteLine("+5  "+factorial);
					}
					else if((factorial/1000)%10==0)
					{
						factorial = (factorial/1000)%10;
						zeros+=4;
						Console.WriteLine("+4  "+factorial);
					}
					else if((factorial/100)%10==0)
					{
						factorial = (factorial/100)%10;
						zeros+=3;
						Console.WriteLine("+3  "+factorial);
					}
					else if((factorial/10)%10==0)
					{
						factorial = (factorial/10)%10;
						zeros+=2;
						Console.WriteLine("+2  "+factorial);
					}
					else if((factorial/1)%10==0)
					{
						factorial = (factorial/1)%10;
						zeros+=1;
						Console.WriteLine("+1  "+factorial);
					}
					else if((factorial/1)%10==0)
					{
						factorial = (factorial/1)%10;
						zeros++;
						Console.WriteLine("1  "+factorial);
					}
					else
					{
						Console.WriteLine("NO ZERO!");
					}
					
					
					Console.WriteLine("="+factorial);
				}
				Console.WriteLine("out of if fact>0");
			

		}
	}
}/*/
